package lib

import (
	"github.com/remrain/weakjson"
	"strconv"
)

func Copy(to interface{}, from interface{}) error {
	encoded, err := weakjson.Marshal(from)
	if err != nil {
		return err
	}
	err = weakjson.Unmarshal(encoded, to)
	return err
}

func ToInt(v string) int {
	value, _ := strconv.Atoi(v)
	return value
}
